/******************************************************************************
* SVN­Version­Information:
* ­­­­­­­­­­­­­­­­­­­­­­­­---------------------
* $LastChangedRevision: 6 $
* $LastChangedBy: c.a.duevel $
* $LastChangedDate: 2009-08-26 15:12:37 +0000 (Wed, 26 Aug 2009) $
* $HeadURL: http://robofight.googlecode.com/svn/trunk/ClientJavaFX/src/de/hft_stuttgart/robofight/client/javafx/util/CustomButton.fx $
******************************************************************************/
package de.hft_stuttgart.robofight.client.javafx.util;

import javafx.scene.Cursor;
import javafx.scene.CustomNode;
import javafx.scene.effect.Effect;
import javafx.scene.effect.Glow;
import javafx.scene.Group;
import javafx.scene.input.MouseEvent;
import javafx.scene.Node;

/**
 * @author ralf.dauenhauer@gmx.de
 */

public class CustomButton extends CustomNode{

var glowEffect : Effect;
public var buttonBg : Node;
public var buttonLabel : Node;
public var buttonPressed : Node;
public var action : function() : Void;

override public function create():Group {
                Group {
                content : buttonBg
                cursor: Cursor.HAND
                effect: bind glowEffect
                onMouseClicked: function (e: MouseEvent) : Void {
                    action();
                }
//                onMouseExited: function( e: MouseEvent ):Void {
//                    glowEffect = null;
//                }
//                onMouseEntered: function( e: MouseEvent ):Void {
//                    glowEffect = Glow {
//                        level: 0.3;
//                    }
//                }
                
            }
        }
}
